<?php

namespace App\Admin\Extensions;

use App\Model\User;
use App\Model\UserFreezeLog;
use App\Model\UserReport;
use Encore\Admin\Admin;

class ReportStatusOp extends BaseAction
{
    protected function render()
    {
        $options = '';
        foreach (UserFreezeLog::REASON_TYPE as $k => $type) $options .= '<option value="' . $k . '">' . $type . '</option>';
        $html = '<select id="freeze_type" class="form-control input-sm" style="width:200px; margin:2px 15%">' . $options . '</select>';
        Admin::script($this->script($this->actionUrl, $html));
        $recordId = $this->row->id;
        $btn = $this->buildButton('ok', '已处理', ['id' => $recordId, 'status' => 2, 'action' => 'status']);
        if (!$recordId) return '';
        $str = [];
        if ($this->row->flag == 1) $str[] = $btn;
        return '<br/><br/>' . implode('<br/><br/>', $str);
    }
}
